package ru.rchervot.sanasar.client.view;

import ru.rchervot.sanasar.client.place.Place;

import com.google.gwt.event.shared.HandlerManager;

public abstract class AbstractRecordEditPresenter implements RecordEditPresenter {
	
	protected final HandlerManager eventBus;
	protected final Display display;
	
	AbstractRecordEditPresenter(Display display, HandlerManager eventBus) {
		this.display = display;
		this.eventBus = eventBus;
	}
	
	@Override
	public void bindDisplay() {
		display.setPresenter(this);
	}
	
	@Override
	public Display getDisplay() {
		return display;
	}
  
  @Override
	public void go(Place place) {
		// TODO Auto-generated method stub
		
	}

  
//	AbstractRecordEditPresenter(HandlerManager eventBus, Display display){
//		super(eventBus, display);
		
		//temp
//		eventBus.addHandler(NewRecordEvent.TYPE,
//				new NewRecordEventHandler() {
//			public void onNewRecordChange(NewRecordEvent event) {
//				
//				Candidate candidate = event.getCandidate();
				
// TODO why code below is important?				
//				if (currentCandidateId.equals(candidate.getId())) {
//					renderCandidate(candidate);
//				}
//			}
//		});
//	}
	

}